package org.example.order.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @Author : wer
 * @Date: 2025/6/22 12:18
 * @Description: 请求拦截器
 */

@Component
public class XTokenRequestInterceptor implements RequestInterceptor {

    /**
     * 请求拦截器
     *
     * @param requestTemplate 请求模版
     */
    @Override
    public void apply(RequestTemplate requestTemplate) {
        System.out.println("拦截器启动......");
        requestTemplate.header("x-token", UUID.randomUUID().toString());
    }
}
